mkdir -p /opt/mydata/docker/mysql/conf
mkdir -p /opt/mydata/docker/mysql/logs
mkdir -p /opt/mydata/docker/mysql/data
docker run \
--name mysql \
-p 3389:3306 \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql:8.0.20

docker run --name=mysql \
--hostname=216851cd8714 \
--mac-address=02:42:ac:11:00:04 \
--env=MYSQL_ROOT_PASSWORD=root \
--volume=/opt/xk/docker/mysql/conf:/etc/mysql \
--volume=/opt/xk/docker/mysql/logs:/logs \
--volume=/opt/xk/docker/mysql/data:/var/lib/mysql \
--volume=/etc/localtime:/etc/localtime \
--privileged -p 3306:3306 --expose=33060 --restart=unless-stopped \
--runtime=runc --detach=true mysql:8.0.20 mysqld





docker exec -it mysql bash
docker cp mysql:/etc/mysql /opt/mydata/docker/mysql/conf
docker stop mysql
docker rm mysql

docker run --name=mysql  \
--env=MYSQL_ROOT_PASSWORD=root \
--volume=/opt/xk/docker/mysql/conf:/etc/mysql \
--volume=/opt/xk/docker/mysql/logs:/logs \
--volume=/opt/xk/docker/mysql/data:/var/lib/mysql \
--privileged -p 3306:3306  \
--restart=unless-stopped \
mysql:8.0.20 mysqld





docker run \
-p 3306:3306 \
--name mysql \
--privileged=true \
--restart unless-stopped \
-v /opt/xk/docker/mysql/conf:/etc/mysql \
-v /opt/xk/docker/mysql/logs:/logs \
-v /opt/xk/docker/mysql/data:/var/lib/mysql \
-v /opt/xk/docker/mysql/mysql-files:/var/lib/mysql-files \
-v /etc/localtime:/etc/localtime \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:8.0.20
docker exec -it mysql bash
#select host, user from user;
update user set host = '%' where user = 'root';
alter user 'root'@'%' identified with mysql_native_password by 'Wo@591511';
flush privileges;
docker run \
--name nacos \
-p 8848:8848 \
-p 9848:9848 \
-p 9849:9849 \
--privileged=true \
--restart=always \
-e JVM_XMS=256m \
-e JVM_XMX=256m \
-e MODE=standalone \
-e PREFER_HOST_MODE=hostname \
-e SPRING_DATASOURCE_PLATFORM=mysql \
-e MYSQL_SERVICE_HOST=192.168.2.100 \
-e MYSQL_SERVICE_PORT=3306 \
-e MYSQL_SERVICE_DB_NAME=nacos_config \
-e MYSQL_SERVICE_USER=xiaoming \
-e MYSQL_SERVICE_PASSWORD=xiaoming \
-v /opt/xk/docker/nacos/logs:/home/nacos/logs \
-v /opt/xk/docker/nacos/init.d/custom.properties:/etc/nacos/init.d/custom.properties \
-v /opt/xk/docker/nacos/data:/home/nacos/data \
-d nacos/nacos-server:v2.0.3


mkdir -p /opt/xk/docker/minio/data
docker run -p 9000:9000 -p 9090:9090 \
 --name minio \
 -d --restart=always \
 -e "MINIO_ROOT_USER=adminminio" \
 -e "MINIO_ROOT_PASSWORD=adminminio" \
 -v /opt/xk/docker/minio/data:/data \
 -v /opt/xk/docker/minio/config:/root/.minio \
 minio/minio server \
 /data --console-address ":9090" -address ":9000"


mkdir -p /opt/xk/docker/minio/data1
mkdir -p /opt/xk/docker/minio/data2
mkdir -p /opt/xk/docker/minio/data3
mkdir -p /opt/xk/docker/minio/data4
#最新
docker run -p 9000:9000 -p 9099:9099 \
 --name minio \
 -d --restart=always \
 -e "MINIO_ROOT_USER=adminminio" \
 -e "MINIO_ROOT_PASSWORD=adminminio" \
 -v /opt/xk/docker/minio/data:/data \
 -v /opt/xk/docker/minio/config:/root/.minio \
 quay.io/minio/minio server \
 /data --console-address ":9099" -address ":9000"


mkdir -p /opt/xk/docker/minio/data1
mkdir -p /opt/xk/docker/minio/data2
mkdir -p /opt/xk/docker/minio/data3
mkdir -p /opt/xk/docker/minio/data4
docker run -p 9000:9000 -p 9090:9090 \
 --name minio \
 -d --restart=always \
 -e "MINIO_ACCESS_KEY=xuecheng" \
 -e "MINIO_SECRET_KEY=xuecheng" \
 -e "MINIO_ROOT_USER=adminminio" \
 -e "MINIO_ROOT_PASSWORD=adminminio" \
 -v /opt/xk/docker/minio/data1:/mydata/minio/data1 \
 -v /opt/xk/docker/minio/data2:/mydata/minio/data2 \
 -v /opt/xk/docker/minio/data3:/mydata/minio/data3 \
 -v /opt/xk/docker/minio/data4:/mydata/minio/data4 \
 quay.io/minio/minio server /data{1...4}\
 --console-address ":9090" -address ":9000"


#docker run \
#  -p 9000:9000 \
#  -p 9001:9001 \
#  minio/minio server /data --console-address ":9001"
#
#也可以使用docker-compose来运行。
#
#编写docker-compose.yaml
#
#version: '3'
#services:
#  minio:
#    image: minio/minio
#    hostname: "minio"
#    ports:
#      - 9000:9000
#      - 9001:9001
#    environment:
#      MINIO_ACCESS_KEY: admin #控制台登录账号
#      MINIO_SECRET_KEY: 12345678 #控制台登录密码
#    volumes:
#      - ./data:/data      #存储路径
#      - ./config:/root/.minio/   #配置文件
#    command: server --console-address ':9001' /data
#    privileged: true
#    restart: always
#
#创建挂载的文件目录，运行docker-compos启动。
#
#docker-compser up -d



docker run \
 --restart=always unless-stopped \
 --log-opt max-size=100m \
 --log-opt max-file=2 \
 -p 6379:6379 \
 --name redis \
 -v /opt/xk/docker/redis/conf/redis.conf:/etc/redis/redis.conf \
 -v /opt/xk/docker/redis/data:/data \
 -d redis:6.2 redis-server /etc/redis/redis.conf  \
 --appendonly yes \
 --requirepass redis




docker run -d --name rabbitmq \
-p 5672:5672 -p 15672:15672 \
-v /opt/xk/docker/rabbitmq:/var/lib/rabbitmq \
--hostname myRabbit \
-e RABBITMQ_DEFAULT_VHOST=my_vhost  rabbitmq:3.9

-e RABBITMQ_DEFAULT_USER=admin \
-e RABBITMQ_DEFAULT_PASS=admin



#[root@localhost rabbitmq]# docker exec -it rabbitmq /bin/bash
#root@myRabbit:/# rabbitmqctl add_user admin admin
#Adding user "admin" ...
#Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
#root@myRabbit:/# rabbitmqctl set_user_tags admin administrator
#Setting tags for user "admin" to [administrator] ...
#root@myRabbit:/# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
#Setting permissions for user "admin" in vhost "/" ...
#Error:
#Virtual host / does not exist
#root@myRabbit:/# rabbitmqctl set_permissions -p my_vhost admin ".*" ".*" ".*"
#Setting permissions for user "admin" in vhost "my_vhost" ...
#root@myRabbit:/#
#
#进入容器后开启插件,才能进行远程访问
#
#root@myRabbit:/# rabbitmq-plugins enable rabbitmq_management
#Enabling plugins on node rabbit@myRabbit:
#rabbitmq_management
#The following plugins have been configured:
#  rabbitmq_management
#  rabbitmq_management_agent
#  rabbitmq_prometheus
#  rabbitmq_web_dispatch
#Applying plugin configuration to rabbit@myRabbit...
#The following plugins have been enabled:
#  rabbitmq_management
#
#started 1 plugins.
#root@myRabbit:/#
#


docker run -dit \
	--name es \
    -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
    -e "discovery.type=single-node" \
    --privileged \
    --network es-net \
    -p 9200:9200 \
    -p 9300:9300 \
docker.elastic.co/elasticsearch/elasticsearch:8.7.0




docker run --name es01 \
--net es-net \
-p 9200:9200 \
-p 9300:9300 \
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
-e "discovery.type=single-node" \
-itd docker.elastic.co/elasticsearch/elasticsearch:8.7.0


docker cp -L es01:/usr/share/elasticsearch/plugins /data/docker/es
docker cp -L es01:/usr/share/elasticsearch/data /data/docker/es
docker cp -L es01:/usr/share/elasticsearch/config /data/docker/es

docker run -dit \
--name myes \
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
-e "discovery.type=single-node" \
-v /data/docker/es/data:/usr/share/elasticsearch/data \
-v /data/docker/es/plugins:/usr/share/elasticsearch/plugins \
-v /data/docker/es/config:/usr/share/elasticsearch/config \
--privileged \
--network es-net \
-p 9200:9200 \
-p 9300:9300 \
docker.elastic.co/elasticsearch/elasticsearch:8.7.0

#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#✅ Elasticsearch security features have been automatically configured!
#✅ Authentication is enabled and cluster connections are encrypted.
#
#ℹ️  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
#  ucMxL-fni=U5oE1UUQAz
#
#ℹ️  HTTP CA certificate SHA-256 fingerprint:
#  e3c769ead38f487e6956dac3f03fc24e25ee083e86482acaacc9680754bffef0
#
#ℹ️  Configure Kibana to use this cluster:
#• Run Kibana and click the configuration link in the terminal when Kibana starts.
#• Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
#  eyJ2ZXIiOiI4LjcuMCIsImFkciI6WyIxNzIuMTkuMC4yOjkyMDAiXSwiZmdyIjoiZTNjNzY5ZWFkMzhmNDg3ZTY5NTZkYWMzZjAzZmMyNGUyNWVlMDgzZTg2NDgyYWNhYWNjOTY4MDc1NGJmZmVmMCIsImtleSI6Imh1UHdSSWNCRVpjSUFDZXBUemg4OnFwaTdfZjc4U2ZhcExxdk02VEhDa2cifQ==
#
#ℹ️ Configure other nodes to join this cluster:
#• Copy the following enrollment token and start new Elasticsearch nodes with `bin/elasticsearch --enrollment-token <token>` (valid for the next 30 minutes):
#  eyJ2ZXIiOiI4LjcuMCIsImFkciI6WyIxNzIuMTkuMC4yOjkyMDAiXSwiZmdyIjoiZTNjNzY5ZWFkMzhmNDg3ZTY5NTZkYWMzZjAzZmMyNGUyNWVlMDgzZTg2NDgyYWNhYWNjOTY4MDc1NGJmZmVmMCIsImtleSI6ImgtUHdSSWNCRVpjSUFDZXBUemg5OmRnVFB0aF9OVHdPRU0yNU13QjBKa2cifQ==
#
#  If you're running in Docker, copy the enrollment token and run:
#  `docker run -e "ENROLLMENT_TOKEN=<token>" docker.elastic.co/elasticsearch/elasticsearch:8.7.0`
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

icsearch.cluster.uuid":"Hxa6HYRBQQ2rzuuLPTX5Dw","elasticsearch.node.id":"EiNVVqw5RamXr1ZXUFMaTQ","elasticsearch.node.name":"6de5c87c4ffd","elasticsearch.cluster.name":"docker-cluster"}
2023-06-28T06:07:25.942183824Z
2023-06-28T06:07:25.942209212Z
2023-06-28T06:07:25.942213333Z
2023-06-28T06:07:25.942216193Z
2023-06-28T06:07:25.942219065Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2023-06-28T06:07:25.942223773Z ✅ Elasticsearch security features have been automatically configured!
2023-06-28T06:07:25.942233956Z ✅ Authentication is enabled and cluster connections are encrypted.
2023-06-28T06:07:25.942237422Z
2023-06-28T06:07:25.942240219Z ℹ️  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
2023-06-28T06:07:25.942243649Z   8Z5cbeKl8Z9ONsZOyQUn
2023-06-28T06:07:25.942246764Z
2023-06-28T06:07:25.942253040Z ℹ️  HTTP CA certificate SHA-256 fingerprint:
2023-06-28T06:07:25.942256111Z   6cad3b19a8e23250e61cdc841a5e665469d860a9ed19583cea791100e917fd2f
2023-06-28T06:07:25.942259127Z
2023-06-28T06:07:25.942261895Z ℹ️  Configure Kibana to use this cluster:
2023-06-28T06:07:25.942297653Z • Run Kibana and click the configuration link in the terminal when Kibana starts.
2023-06-28T06:07:25.942302166Z • Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
2023-06-28T06:07:25.942305306Z   eyJ2ZXIiOiI4LjcuMCIsImFkciI6WyIxNzIuMTkuMC4yOjkyMDAiXSwiZmdyIjoiNmNhZDNiMTlhOGUyMzI1MGU2MWNkYzg0MWE1ZTY2NTQ2OWQ4NjBhOWVkMTk1ODNjZWE3OTExMDBlOTE3ZmQyZiIsImtleSI6InM4aWRBSWtCNXFKZDhXX0hJSGExOjVtVHZiYm5sU2xLR0QzeDJuVnpMRWcifQ==
2023-06-28T06:07:25.942308773Z
2023-06-28T06:07:25.942311492Z ℹ️ Configure other nodes to join this cluster:
2023-06-28T06:07:25.942314448Z • Copy the following enrollment token and start new Elasticsearch nodes with `bin/elasticsearch --enrollment-token <token>` (valid for the next 30 minutes):
2023-06-28T06:07:25.942317745Z   eyJ2ZXIiOiI4LjcuMCIsImFkciI6WyIxNzIuMTkuMC4yOjkyMDAiXSwiZmdyIjoiNmNhZDNiMTlhOGUyMzI1MGU2MWNkYzg0MWE1ZTY2NTQ2OWQ4NjBhOWVkMTk1ODNjZWE3OTExMDBlOTE3ZmQyZiIsImtleSI6InRNaWRBSWtCNXFKZDhXX0hJSGE4OndTUmZKdHJLUzVLdS1wR0NDb28zaXcifQ==
2023-06-28T06:07:25.942320964Z
2023-06-28T06:07:25.942323670Z   If you're running in Docker, copy the enrollment token and run:
2023-06-28T06:07:25.942328196Z   `docker run -e "ENROLLMENT_TOKEN=<token>" docker.elastic.co/elasticsearch/elasticsearch:8.7.0`
2023-06-28T06:07:25.942331582Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2023-06-28T06:07:25.942335770Z
2023-06-28T06:07:25.942338523Z
2023-06-28T06:07:25.942341209Z
2023-06-28T06:07:25.942343879Z




WARNING: Owner of file [/usr/share/elasticsearch/config/users] used to be [root], but now is [elasticsearch]
WARNING: Owner of file [/usr/share/elasticsearch/config/users_roles] used to be [root], but now is [elasticsearch]
This tool will reset the password of the [elastic] user to an autogenerated value.
The password will be printed in the console.
Please confirm that you would like to continue [y/N]y


Password for the [elastic] user successfully reset.
Password for the [elastic] user successfully reset.
New value: +_GzYu17o7bTt8tC0f2g
elasticsearch@5cfc1677fedc:~$ +_GzYu17o7bTt8tC0f2g


#进入容器
docker exec -it myes bash
sh ./elasticsearch-reset-password -u elastic
#重新生成kibana的token
bin/elasticsearch-create-enrollment-token --scope kibana


docker pull docker.elastic.co/kibana/kibana:8.7.0

docker run --name kib \
--net es-net \
-p 5601:5601 \
-itd docker.elastic.co/kibana/kibana:8.7.0

docker exec -it kib bash


docker cp -L kib:/usr/share/kibana/logs /data/docker/kibana
docker cp -L kib:/usr/share/kibana/data /data/docker/kibana
docker cp -L kib:/usr/share/kibana/config /data/docker/kibana

docker run --name kib \
--net es-net \
-p 5601:5601 \
-v /data/docker/kibana/data:/usr/share/kibana/data \
-v /data/docker/kibana/logs:/usr/share/kibana/logs \
-v /data/docker/kibana/config:/usr/share/kibana/config \
-itd docker.elastic.co/kibana/kibana:8.7.0




mkdir -p /opt/xk/docker/gitlab/etc
mkdir -p /opt/xk/docker/gitlab/log
mkdir -p /opt/xk/docker/gitlab/opt

docker run \
 -itd  \
 -p 9980:9980 \
 -p 9922:9922 \
 -v /opt/xk/docker/gitlab/etc:/etc/gitlab  \
 -v /opt/xk/docker/gitlab/log:/var/log/gitlab \
 -v /opt/xk/docker/gitlab/opt:/var/opt/gitlab \
 --restart always \
 --privileged=true \
 --name gitlab \
 gitlab/gitlab-ce
3、修改配置
#进容器内部
docker exec -it gitlab /bin/bash

#修改gitlab.rb
vi /etc/gitlab/gitlab.rb

#加入如下
#gitlab访问地址，可以写域名。如果端口不写的话默认为80端口
#external_url 'http://192.168.3.194'
#ssh主机ip
#gitlab_rails['gitlab_ssh_host'] = '192.168.124.194'
#ssh连接端口
#gitlab_rails['gitlab_shell_ssh_port'] = 9922

# 让配置生效
gitlab-ctl reconfigure


1、Gitlab镜像
# 查找Gitlab镜像
docker search gitlab


# 拉取Gitlab镜像
docker pull gitlab/gitlab-ce:latest




2、启动Gitlab容器
# 启动容器
docker run \
 -itd  \
 -p 9980:80 \
 -p 9922:22 \
 -v /home/gitlab/etc:/etc/gitlab  \
 -v /home/gitlab/log:/var/log/gitlab \
 -v /home/gitlab/opt:/var/opt/gitlab \
 --restart always \
 --privileged=true \
 --name gitlab \
 gitlab/gitlab-ce


命令	描述
-i	 以交互模式运行容器，通常与 -t 同时使用命令解释
-t	 为容器重新分配一个伪输入终端，通常与 -i 同时使用
-d	后台运行容器，并返回容器ID
-p 9980:80	将容器内80端口映射至宿主机9980端口，这是访问gitlab的端口
-p 9922:22	 将容器内22端口映射至宿主机9922端口，这是访问ssh的端口
-v /home/gitlab/etc:/etc/gitlab	将容器/etc/gitlab目录挂载到宿主机/usr/local/gitlab-test/etc目录下，若宿主机内此目录不存在将会自动创建，其他两个挂载同这个一样
--restart always	容器自启动
--privileged=true	让容器获取宿主机root权限
--name gitlab	设置容器名称为gitlab
gitlab/gitlab-ce	镜像的名称，这里也可以写镜像ID
接下来的配置请在容器内进行修改，不要在挂载到宿主机的文件上进行修改。否则可能出现配置更新不到容器内，或者是不能即时更新到容器内，导致gitlab启动成功，但是无法访问

 3、修改配置
#进容器内部
docker exec -it gitlab /bin/bash

#修改gitlab.rb
vi /etc/gitlab/gitlab.rb

#加入如下
#gitlab访问地址，可以写域名。如果端口不写的话默认为80端口
external_url 'http://192.168.124.194'
#ssh主机ip
#gitlab_rails['gitlab_ssh_host'] = '192.168.124.194'
#ssh连接端口
#gitlab_rails['gitlab_shell_ssh_port'] = 9922

# 让配置生效
gitlab-ctl reconfigure




### 注意不要重启，/etc/gitlab/gitlab.rb文件的配置会映射到gitlab.yml这个文件，由于咱们在docker中运行，在gitlab上生成的http地址应该是http://192.168.124.194:9980,所以，要修改下面文件

# 修改http和ssh配置
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml

  gitlab:
    host: 192.168.124.194
    port: 9980 # 这里改为9980
    https: false




#重启gitlab
gitlab-ctl restart
#退出容器
exit
4、浏览器访问
路径访问：http://192.168.124.194:9980/

# 机器配置要大于4g，否则很容易启动不了，报502



# 第一次访问，会让修改root密码
# 修改后以root用户登录即可


5、 修改root密码
# 进入容器内部
docker exec -it gitlab /bin/bash

# 进入控制台
gitlab-rails console -e production

# 查询id为1的用户，id为1的用户是超级管理员
#user = User.where(id:1).first
# 修改密码为lhx123456
user.password='lhx123456'
# 保存
user.save!
# 退出
exit



#6、Gitlab操作
#创建分组，创建项目





# 至此，Docker搭建Gitlab服务器完成！！！


docker run -d -p 2121:21 -p 2020:20 -p 21100-21110:21100-21110 \
-v /xu/docker/ftp/admin:/home/vsftpd/admin \
-e FTP_USER=admin \
-e FTP_PASS=111111 \
-e PASV_ADDRESS=123.57.249.112 \
-e PASV_MIN_PORT=21100 \
-e PASV_MAX_PORT=21110 \
--name vsftpd \
--restart=always fauria/vsftpd


docker run -d -p  21:21 -p  20:20 -p 21100-21110:21100-21110 -v /xu/docker/ftp/vsftpd:/home/vsftpd -e FTP_USER=admin -e FTP_PASS=111111   -e PASV_MIN_PORT=21100 -e PASV_MAX_PORT=21110 -e PASV_ADDRESS=123.57.249.112 -e PASV_ENABLE=YES --name ftp --restart=always --privileged=true fauria/vsftpd
#mongodb
  docker run -itd --name mongodb --restart=always --privileged \
  -p 27017:27017 -v /opt/xk/docker/mongo/db:/data/db \
  -v /opt/xk/docker/mongo/configdb:/data/configdb \
  -v /opt/xk/docker/mongo/log:/data/log mongo:latest --auth


#    db.createUser({user:"powerjob",pwd:"powerjob",roles: [{role:"userAdminAnyDatabase",db:"powerjob-product"}]});



    version: "3.1"
    services:
      mongo:
        image: mongo:5.0.5
        container_name: mongo
        restart: always
        ports:
          - 27001:27017
        volumes:
          - /opt/xk/docker/mongo/db:/data/db
          - /opt/xk/docker/mongo/log:/var/log/mongodb
          - /opt/xk/docker/mongo:/etc/mongo
        command: mongod  --auth

      docker run -itd --name mongodb --restart=always --privileged \
      -p 27017:27017 -v /opt/xk/docker/mongo/db:/data/db \
      -v /opt/xk/docker/mongo/configdb:/data/configdb \
      -v /opt/xk/docker/mongo/log:/data/log mongo:latest --auth



#      db.createUser({user:"powerjob",pwd:"powerjob",roles: [{role:"userAdminAnyDatabase",db:"powerjob-product"}]});
#    }

docker run --name=minio  --env=MINIO_ROOT_USER=adminminio --env=MINIO_ROOT_PASSWORD=adminminio --env=MINIO_ACCESS_KEY=xuecheng --env=MINIO_SECRET_KEY=xuecheng --volume=/opt/xk/docker/minio/data:/mydata/minio/data -p 9000:9000 -p 9099:9099 --restart=always  --detach=true quay.io/minio/minio server /data --console-address :9099 -address :9000




//jenkins


docker run \
-u root \
-d \
--restart=always \
--name jenkins \
-p 8080:8080  \
-p 50000:50000  \
-v /usr/java/jdk-11:/usr/java/jdk-11 \
-v /opt/maven/apache-maven-3.9.3:/opt/maven/apache-maven-3.9.3 \
-v /opt/jenkins/jenkins_home:/var/jenkins_home \
-v /opt/gradle/gradle-8.2.1:/opt/gradle/gradle-8.2.1 \
jenkins/jenkins:lts
docker run \
-u root \
-d \
--restart=always \
--name jenkins \
-p 8880:8080  \
-p 50000:50000  \
-v /usr/java/jdk-11:/usr/java/jdk-11 \
-v /opt/maven/apache-maven-3.9.2:/opt/maven/apache-maven-3.9.2 \
-v /opt/jenkins/jenkins_home:/var/jenkins_home \
jenkins/jenkins:latest
//替换插件源
cd /updates
sed -i 's/https:\/\/updates.jenkins.io\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json